package com.d5xx.hunters.events;

import com.d5xx.hunters.API.Hunter;
import com.d5xx.hunters.API.HunterPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityPickupItemEvent;

public class PlayerPickupItem implements Listener {
    @EventHandler
    public void onPlayerPickupItem(EntityPickupItemEvent event) {
        if (!(event.getEntity() instanceof Player player)) return;
        HunterPlayer hunterPlayer = Hunter.getHunterPlayer(player);
        if (!hunterPlayer.getType().equals("game")) {
            event.setCancelled(true);
        }
    }
}
